var ajax = require('../../utils/ajax.js');

Page({
	data: {
		dataLoaded: false,
		waiter: {}
	},

	onLoad(options) {

		this.techId = options.id || 1;

		this._getPageData();

	},

	_getPageData() {
		var _self = this;

		ajax.P('/openapi/CTechnician/info', {
			technician_id: _self.techId
		}, function(data) {

			_self.setData({
				waiter: data.result.info,
				tagList: data.result.info.tags,
				dataLoaded: true
			});

		});
	},

	_preview(evt){
		var photos = this.data.waiter.photo;
		var cur = evt.currentTarget.dataset.url;

		wx.previewImage({
			current: cur,
			urls: photos
		})
	}

});